home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / tbsrc / file7.frm < prev    next >
Text File  |  1994-10-09  |  4KB  |  153 lines

  1. VERSION 2.00
  2. Begin Form wndToolBar 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Toolbar"
  5.    ClientHeight    =   2040
  6.    ClientLeft      =   570
  7.    ClientTop       =   1770
  8.    ClientWidth     =   4215
  9.    ControlBox      =   0   'False
  10.    FontBold        =   0   'False
  11.    FontItalic      =   0   'False
  12.    FontName        =   "MS Serif"
  13.    FontSize        =   6
  14.    FontStrikethru  =   0   'False
  15.    FontUnderline   =   0   'False
  16.    Height          =   2445
  17.    Left            =   510
  18.    LinkTopic       =   "Form1"
  19.    MaxButton       =   0   'False
  20.    MinButton       =   0   'False
  21.    ScaleHeight     =   136
  22.    ScaleMode       =   3  'Pixel
  23.    ScaleWidth      =   281
  24.    Top             =   1425
  25.    Width           =   4335
  26.    Begin PictureBox Toolbar 
  27.       AutoRedraw      =   -1  'True
  28.       BackColor       =   &H00C0C0C0&
  29.       BorderStyle     =   0  'None
  30.       ClipControls    =   0   'False
  31.       Height          =   855
  32.       Left            =   0
  33.       ScaleHeight     =   855
  34.       ScaleWidth      =   4215
  35.       TabIndex        =   0
  36.       Top             =   135
  37.       Width           =   4215
  38.    End
  39. End
  40. Option Explicit
  41.  
  42. Dim StartExit               As Integer
  43. Dim StartInit               As Integer
  44. Dim Titel                   As String
  45.  
  46. Sub Form_Activate ()
  47.     StartInit = False
  48.     SizeControl Toolbar
  49.     If Me.WindowState <> 0 Then Beep: Me.WindowState = 0
  50.     vbQHCalcToolPos Toolbar
  51.     Toolbar.Refresh
  52.     If Me.WindowState <> 0 Then Me.WindowState = 0
  53.     ChangeBar = False
  54. End Sub
  55.  
  56. Sub Form_DblClick ()
  57.     StartExit = -StartExit
  58. End Sub
  59.  
  60. Sub Form_Load ()
  61. Dim h As Integer
  62. Dim col As Long
  63.     StartInit = True
  64.     Titel = Me.Caption
  65.     Me.Tag = Titel
  66.     Me.Caption = Chr$(0)
  67.     Me.AutoRedraw = True
  68.     Me.Move GetSystemMetrics(0) * Screen.TwipsPerPixelX, GetSystemMetrics(1) * Screen.TwipsPerPixelY
  69.     Me.AutoRedraw = False
  70.     Me.Refresh
  71.     SetChild Me.hWnd, MDIParent.hWnd, True
  72. End Sub
  73.  
  74. Sub Form_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  75. Dim dc As Integer
  76. Dim dx As Integer, dy As Integer
  77. Dim mPos As apiPoint
  78. Dim oldpos As apiPoint
  79. Dim mRect As apiRect
  80.     StartExit = False
  81.     If Y < 9 Then
  82.         If X > 10 Then
  83.             vbQHFakeMove Me
  84.         Else
  85.             Me.DrawMode = 6
  86.             If Me.BorderStyle Then
  87.                 Me.Line (0, 0)-(10, 7), 0, BF
  88.             Else
  89.                 Me.Line (1, 1)-(10, 7), 0, BF
  90.             End If
  91.             StartExit = True
  92.             Me.DrawMode = 13
  93.         End If
  94.     End If
  95. End Sub
  96.  
  97. Sub Form_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  98.     Me.DrawMode = 13
  99.     Me.Cls
  100.     If StartExit = 1 Then Unload Me
  101. End Sub
  102.  
  103. Sub Form_Paint ()
  104. Dim w As Integer, h As Integer
  105. Dim col As Long
  106. Static IsPainting As Integer
  107.     If StartInit Then Exit Sub
  108.     If IsPainting Then Exit Sub
  109.     IsPainting = True
  110.     w = Me.ScaleWidth
  111.     Me.AutoRedraw = True
  112.     If Me.BorderStyle Then
  113.         h = 0
  114.     Else
  115.         h = 1
  116.     End If
  117.     Me.Line (0, 0)-(10, 10), RGB(192, 192, 192), BF
  118.     col = GetSysColor(2)
  119.     Me.Line (12, h)-(w - 1, 7), col, BF         ' Titelleiste
  120.     Me.Line (h, 8)-(w, 8), 0                    ' Linie unter Titel
  121.     Me.Line (11, h)-(11, 8), 0                  ' Linie links von Titel
  122.     Me.ForeColor = GetSysColor(9)
  123.     Me.CurrentX = 11 + (Me.ScaleWidth - 12 - Me.TextWidth(Titel)) / 2
  124.     Me.CurrentY = -1
  125.     If Me.CurrentX > 11 Then Me.Print Titel
  126.  
  127.     Me.Line (3, 2 + h)-(8, 4 + h), 0, B             ' Schwarzes Rechteck
  128.     Me.Line (4, 3 + h)-(8, 3 + h), RGB(255, 255, 255)' Weiss fⁿllen
  129.     Me.Line (4, 5 + h)-(9, 5 + h), RGB(128, 128, 128)' Schatten unten
  130.     Me.Line (9, 3 + h)-(9, 6 + h), RGB(128, 128, 128)' Schatten rechts
  131.     Me.AutoRedraw = False
  132.     Me.Refresh
  133.     IsPainting = False
  134. End Sub
  135.  
  136. Sub Form_Resize ()
  137.     If Not StartInit Then
  138.         SizeControl Toolbar
  139.         If Me.WindowState <> 0 Then Me.WindowState = 0
  140.         vbQHCalcToolPos Toolbar
  141.         Me.Refresh
  142.     End If
  143. End Sub
  144.  
  145. Sub Form_Unload (Cancel As Integer)
  146.     vbQHExit Me
  147. End Sub
  148.  
  149. Sub Toolbar_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  150.     vbQHelpExt Toolbar
  151. End Sub
  152.  
  153.